import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.text.DecimalFormat;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import net.sf.json.JSONObject;

public class Dummy {

	/**
	 * @param args
	 * @throws Exception 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException, Exception {
		float a = 3;
		DecimalFormat df = new DecimalFormat("#.####");
		System.out.println(df.format(a));
		
		URL url = new URL("http://dev.pvxml.map.naver.com/api/get?type=json&pano_id=10163010870&rv=2&v=2.08");
		readToJSON(url.openStream());
	}

	
	static public JSONObject readToJSON(InputStream stream) throws Exception {
	    SAXParserFactory factory = SAXParserFactory.newInstance();
	    factory.setNamespaceAware(true);
	    SAXParser parser = factory.newSAXParser();
	    SAXJsonParser handler = new SAXJsonParser();
	    parser.parse(stream, handler);
	    return handler.getJson();
	}
}
